﻿using Serilog;
using System;
using System.Collections.Generic;
using System.Text;

namespace Ec.NETCoreFramework.Common.Core.Helpers
{
    /// <summary>
    /// 仅在程序startup种记录所用，其他情况请注入Ilogger实现
    /// </summary>
    public class LoggerHelper
    {
        private static readonly Lazy<LoggerHelper> lazy =
        new Lazy<LoggerHelper>(() => new LoggerHelper());

        public static LoggerHelper Instance { get { return lazy.Value; } }

        private LoggerHelper()
        {
        }

        public void Error<T>(string messageTemplate, T t)
        {
            Log.Error<T>(messageTemplate, t);
        }
        public void Error(string messageTemplate)
        {
            Log.Error(messageTemplate);
        }
        public void Information(string messageTemplate)
        {
            Log.Information(messageTemplate);
        }
        public void Information<T>(string messageTemplate, T t)
        {
            Log.Information<T>(messageTemplate, t);
        }
        public void Debug(string messageTemplate)
        {
            Log.Debug(messageTemplate);
        }
    }
}
